﻿using Microsoft.Practices.CompositeWeb;
using Microsoft.Practices.ObjectBuilder;

namespace CSC440TeamOne.Admin.Views
{
    /// <summary>
    /// Name - SubmittedRecipesPresenter.cs
    /// Description - Encapsulates all client requests from the SubmittedRecipesView
    /// Programmer - Mike Beck
    /// Date coded - 11/27/2011
    /// Arguments - IAdminController
    /// Variables - None
    /// Files accessed by this code artifact - None
    /// Files changed by this code artifact - None
    /// I/O - None
    /// Error Handling - None
    /// Modifications -
    ///     1.0 - Initial Coding
    /// Known Faults - 
    ///     1.0 - None known
    /// </summary>
    public class SubmittedRecipesPresenter : Presenter<ISubmittedRecipesView>
    {

        // NOTE: Uncomment the following code if you want ObjectBuilder to inject the module controller
        //       The code will not work in the Shell module, as a module controller is not created by default
        //
         private IAdminController _controller;

        /// <summary>
        /// Initializes a new instance of the <see cref="SubmittedRecipesPresenter"/> class.
        /// </summary>
        /// <param name="controller">The controller.</param>
         public SubmittedRecipesPresenter([CreateNew] IAdminController controller)
         {
         		_controller = controller;
         }

        /// <summary>
        /// Called when [view loaded].
        /// </summary>
        public override void OnViewLoaded()
        {
            
        }

        /// <summary>
        /// Called when [view initialized].
        /// </summary>
        public override void OnViewInitialized()
        {
            View.show(_controller.LoadSubmittedRecipesModel());
        }

        // TODO: Handle other view events and set state in the view
    }
}




